package edu.tamu.cse.teamproject1;

import java.util.List;

import edu.tamu.cse.teamproject1.Database.Exceptions.SqlException;
import edu.tamu.cse.teamproject1.Database.Interfaces.IDatabaseTable;
import edu.tamu.cse.teamproject1.Database.Parser.QueryParser;

/**
 * Class that provides access to the protected methods and properties of the 
 * QueryParser class. 
 * 
 * @author Christopher Weldon <chris@chrisweldon.net>
 */
public class QueryParserExtension extends QueryParser {
	/**
	 * Calls the protected createJoinedTable method
	 * 
	 * @param tables
	 * @return Joined table created via createJoinedTable
	 */
	public IDatabaseTable callCreateJoinedTable(List<IDatabaseTable> tables) {
		return this.createJoinedTable(tables);
	}
	
	/**
	 * Calls the protected trimQueryName method
	 * 
	 * @param queryName
	 * @return Result from trimQueryName
	 * @throws Exception through trimQueryName
	 */
	public String callTrimQueryName(String queryName) throws Exception {
		return this.trimQueryName(queryName);
	}
	
	/**
	 * Calls the protected parseQueryString method
	 * 
	 * @param query
	 * @return Results from parseQueryString()
	 * @throws SqlException from within parseQueryString
	 */
	public String[] callParseQueryString(String query) throws SqlException {
		return this.parseQueryString(query);
	}
	
	/**
	 * Calls the protected method reduceToColumnsNecessary
	 * 
	 * @param columns
	 * @param tempView
	 * @return Result from reduceToColumnsNecessary
	 * @throws Exception
	 */
	public IDatabaseTable callReduceToColumnsNecessary(String columns, IDatabaseTable tempView) throws Exception {
		return this.reduceToColumnsNecessary(columns, tempView);
	}
}
